<?php
require_once './admin-header.php';
require_once './core/admin-sql.php';
$sql = new AdminSql();
if (isset($_GET['tid'])) {
    $get_tid = $_GET['tid'];
} else {
    ?>
    <script>history.go(-1);</script>
    <?php
    return 0;
}
$se_uid = $_SESSION['uid'];
?>
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=0,maximum-scale=1.0"/>
        <title>我的海报</title>
        <link rel="stylesheet" href="../css/base.css">
        <link rel="stylesheet" href="../css/index.css">
        <link rel="stylesheet" href="./css/jquery.xctips.css"/>

        <script>
            function adapte() {//适配
                var designWidth = 1080, rem2px = 100;
                document.documentElement.style.fontSize = window.innerWidth / designWidth * rem2px + "px";
            }
            adapte();
        </script>
        <style>
        </style>
    </head>
    <body>
    <div class="my-poster1">
        <?php
        $res = $sql->searchImFromTaId($_SESSION['uid'], $get_tid);
        if ($res[0] == 1) {
            ?>
            <script>
                window.location.href = "./my.php";
            </script>
            <?php
        } else {
            $im = $res[1];
        }
        ?>
        <div class="img"><img src=".<?= $im ?>" alt="海报"></div>
        <div class="bottom-btn flex2">
            <button class="share fs36"><a href="javascript:;" onclick="adminSharePoster(<?= $se_uid ?>, '<?= $im ?>');">分享</a>
            </button>
            <button class="del fs36"><a href="javascript:;"
                                        onclick="deletePoster(<?= $se_uid ?>, '<?= $get_tid ?>', 1);">删除</a></button>
            <button class="change fs36"><a href="javascript:;" onclick="editPoster(<?= $se_uid ?>, '<?= $get_tid ?>');">修改</a>
            </button>
        </div>
    </div>
    <script src='../script/jquery.js'></script>
    <script src='../script/index.js'></script>
    </body>
    </html>
<?php
require_once './admin-footer.php';